
import QtQuick 2.14
import QtQuick.Controls 2.14
import QtQuick.Layouts 1.14
import QtQuick.Window 2.14
import ModbusDemo 1.0

ApplicationWindow {
    id: window
    visible: true
    width: 800
    height: 600
    title: qsTr("Modbus TCP Demo")

    TabBar {
        id: bar
        width: parent.width

        TabButton {
            text: qsTr("Server")
        }
        TabButton {
            text: qsTr("Client")
        }
    }

    StackLayout {
        anchors.top: bar.bottom
        anchors.bottom: parent.bottom
        anchors.left: parent.left
        anchors.right: parent.right
        currentIndex: bar.currentIndex

        // Server Page
        Loader {
            source: "ModbusServerPage.qml"
        }

        // Client Page
        Loader {
            source: "ModbusClientPage.qml"
        }
    }
}
